﻿using System;
using System.Linq;
using WebApp.Domain;
using WebApp.Data;
using System.Collections.Generic;
using COM.Data;
using COM.Web;
using COM.Service;
using WebApp.Service;

namespace WebApp.Web.Service
{
    /// <summary>
    /// 访问服务的快捷方式,集成常用的服务
    /// </summary>
    public interface IRuntime
    {
        IOperateLogService DbLogService { get; }
        IWebPermissionService Permission { get; }
        IHttpRequestService HttpRequestService { get; }
    }

    public class AppRuntimeService : IRuntime
    {
        public IWebPermissionService Permission
        {
            get
            {
                return Unity.Instance.GetService<IWebPermissionService>();
            }
        }

        public IOperateLogService DbLogService
        {
            get
            {
                return Unity.Instance.GetService<IOperateLogService>();
            }
        }

        public IHttpRequestService HttpRequestService
        {
            get
            {
                return Unity.Instance.GetService<IHttpRequestService>();
            }
        }

    }

    

}
